import {Injectable} from '@angular/core';
import {Subject} from 'rxjs/Subject';

@Injectable()
export class AppService {
  private pageTitle: string;
  private subject: Subject<string> = new Subject();

  constructor() {
  }

  setPageTitle(pageTitle: string) {
    this.subject.next(this.pageTitle = pageTitle);
  }

  getPageTitle(): Subject<string> {
    return this.subject;
  }
}
